<?php
class forms{

	// функция выполнения формы html
	public function eval_form ( $fname, $mdl ){
		global $template;
		$form = "\$r_file=\"" . $this->cor_slashes( addslashes( file_get_contents( 'forms/'.$template->config['name'].'/' . get_class( $mdl ) . '/' . $fname . '.html' ) ) ) . "\";";
		eval ( $form );
		return stripslashes( $r_file );
	}
	
	public function cor_slashes ( $str ){
		$search = array ( '\".','.\"','[\\\'','\\\']' );
		$replace = array ( '".','."','[\'','\']' );
		$replaced = str_replace ( $search, $replace, $str );
		return $replaced;
	}
}
?>